<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>工作动态</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<!--标准mui.css-->
		<link rel="stylesheet" href="../../css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="../../css/comman.css"/>
		<style>
			.title {
				margin: 20px 15px 10px;
				color: #6d6d72;
				font-size: 15px;
			}
		</style>
	</head>
	<body>
		<div class="mui-content">
			
			<ul class="mui-table-view">
				<!--<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right news-image" src="../../img/slide/muwu.jpg">
						<div class="mui-media-body">
							<p class='mui-ellipsis news-content'>静静的看这个世界，最后终于疯了</p>
						</div>
						<div class="news-small">
							<span>发布时间：20160114</span>&nbsp;&nbsp;
							<span>访问量：99</span>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right news-image" src="../../img/slide/muwu.jpg">
						<div class="mui-media-body">
							<p class='mui-ellipsis news-content'>能和心爱的人一起睡觉，是件幸福的事情；可是，打呼噜怎么办？</p>
						</div>
						<div class="news-small">
							<span>发布时间：20160114</span>&nbsp;&nbsp;
							<span>访问量：99</span>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right news-image" src="../../img/slide/muwu.jpg">
						<div class="mui-media-body">
							<p class='mui-ellipsis news-content'>想要这样一间小木屋，夏天挫冰吃瓜，冬天围炉取暖.</p>
						</div>
						<div class="news-small">
							<span>发布时间：20160114</span>&nbsp;&nbsp;
							<span>访问量：99</span>
						</div>
					</a>
				</li>-->
			</ul>
			
</div>
	</body>
	<script type="text/javascript" src="../../js/jquery.js" ></script>
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/pan_config.js"></script>
	<script>
	    var firstload=true;
	    var pagenum=1;
		mui.init({
			swipeBack:true //启用右滑关闭功能
		});
		mui.plusReady(function() {
			loadnewsdata(pagenum);
			document.addEventListener('loadnewsdata',loadnewsdata(pagenum));
			
			
			document.addEventListener("swipedown",function(){
				
				var displayheight=plus.display.resolutionHeight-44;
			    var scroll_top = $(document).scrollTop();
			    var doc_height = $(document).height();			    
				var scroll_top = $(document).scrollTop();
				if(scroll_top==0){//到达最顶部时
			    	firstload=true;
            	    pagenum=1;
                    loadnewsdata(1);
			    }
				
            });
            document.addEventListener("swipeup",function(){
            	var displayheight=plus.display.resolutionHeight-44;
			    var scroll_top = $(document).scrollTop();
			    var doc_height = $(document).height();
			    if((displayheight+scroll_top)>doc_height){//到达最底部时
			       firstload=false;
            	  pagenum++;
                  loadnewsdata(pagenum);
			    }
            	
            });
        });
        function loadnewsdata(pagenum){
        	panUtil.ajaxLoding.start();
	        mui.ajax(baseServerAdrr+'/news/getWorkNews',{
          	   dataType:'json',//服务器返回json格式数据
          	   data: {pagenum:pagenum},
	           type:'post',//HTTP请求类型
	           timeout:30000,//超时时间设置为10秒；
	           success:function(data){
		           panUtil.ajaxLoding.stop();
		           var innerhtml="";
		           if(data.code=='success'){
                         var lists = data.data;
                         for (var i=0;i<lists.length;i++) {
                         	var list=lists[i];
                         	if(list.CHECKER!=null&&list.CHECKER!=""){
                         		innerhtml+='<li class="mui-table-view-cell mui-media">';
                         		innerhtml+='  <a href="javascript:void(0);" onclick=\'detail_see("'+list.ID+'")\'>';
                         		innerhtml+='   <img class="mui-media-object mui-pull-right news-image" src="'+baseServerAdrr.replace("espsl5","")+list.CHECKER+'">';
                         		innerhtml+='   <div class="mui-media-body">';
                         		innerhtml+='      <p class="mui-ellipsis news-content">'+list.TITLE+'</p>';
                         		innerhtml+='   </div>';
                         		innerhtml+='   <div class="news-small">';
                         		innerhtml+='      <span>发布时间：'+list.DATEPUBLISHED+'</span>&nbsp;&nbsp;<span>访问量：'+list.PRINTNUM+'</span>';
                         		innerhtml+='   </div></a></li>';
                         	}else{
                         		innerhtml+='<li class="mui-table-view-cell mui-media">';
                         		innerhtml+='  <a href="javascript:void(0);" onclick=\'detail_see("'+list.ID+'")\'>';
                         		innerhtml+='   <div class="mui-media-body">';
                         		innerhtml+='      <p class="mui-ellipsis news-content">'+list.TITLE+'</p>';
                         		innerhtml+='   </div>';
                         		innerhtml+='   <div class="news-small">';
                         		innerhtml+='      <span>发布时间：'+list.DATEPUBLISHED+'</span>&nbsp;&nbsp;<span>访问量：'+list.PRINTNUM+'</span>';
                         		innerhtml+='   </div></a></li>';
                         	}
                         }
                         if(firstload){
                         	$('.mui-table-view').html(innerhtml);
                         }else{
                         	$('.mui-table-view').append(innerhtml);
                         }
                         
		           }else{
		   	           mui.toast(data.message);
		           }
	            },
	           error:function(xhr,type,errorThrown){
		            //异常处理；
		           panUtil.ajaxLoding.stop();
		           mui.toast('欢迎登陆');
	            }
		    });
        }
        
        function detail_see(ID){
        	mui.openWindow({
        		url:"gzdtdetail.html",
        		id:"gzdtdetail",
        		extras:{ID:ID},
        		waiting:{autoShow:false}
        	});
        }
	</script>
</html>